{% macro render_table(data, indent=0) %}
{%- if data is mapping -%}
{
    {%- for key, value in data.items() -%}
{{ "    " * indent }}["{{ key }}"] = 
    {%- if value is mapping -%}
    {{ render_table(value, indent + 1) }}
    {%- elif value is sequence -%}
    {{ render_list(value, indent + 1) }}
    {%- elif value is string -%}
    "{{ value }}"
    {%- elif value is number -%}
    {{ value }}
    {%- elif value is boolean -%}
    {{ "true" if value else "false" }}
    {%- else -%}
    nil
    {%- endif -%},
    {%- endfor -%}
{{ "    " * (indent - 1) }}}
{%- endif -%}
{% endmacro %}

{% macro render_list(lst, indent=0) %}
{
    {%- for item in lst -%}
{{ "    " * indent }}
    {%- if item is mapping -%}
    {{ render_table(item, indent + 1) }}
    {%- elif item is string -%}
    "{{ item }}"
    {%- elif item is number -%}
    {{ item }}
    {%- elif item is boolean -%}
    {{ "true" if item else "false" }}
    {%- else -%}
    nil
    {%- endif -%},
    {%- endfor -%}
{{ "    " * (indent - 1) }}}
{% endmacro %}

-- Main table
return {{ render_table(data, 1) }}
